<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .xz{
            background-image: url(103.jpg.jpg);
            width: 433px;
            height: 433px;
            border: 0px solid white;
            /* background-color: sienna; */
         
        }
    </style>
</head>
<body>
    <div class="xz">
        <a href="01.html">作业1</a>
        <br>
        <a href="02.html">作业2</a>
        <br>
        <a href="03.html">作业3</a>
        <br>
        <a href="04.html">作业4</a>
        <br>
        <a href="05.html">作业5</a>
        <br>
        <a href="操场.html">作业6</a>
        <br>
        <a href="bady.html">作业7</a>
    </div>




    <p>请点击点赞</p>
    <span id="goodSpan" onclick="sendGood()">
        <img src="img/1.PNG" style="width: 25px; height: 25px;" /> 
    </span>
    [<span id="good"></span>]
        
    <span id="badSpan" onclick="sendBad()">
        <img src="img/1.PNG" style="width: 25px; height: 25px; transform: rotate(180deg);" /> 
    </span>
    [<span id="bad"></span>]
     
    <script>
        /*点赞的数量：*/
        document.getElementById("good").innerText = "";
        var good = document.getElementById("good").textContent;
         
        document.getElementById("bad").innerText  = "";
        var bad = document.getElementById("bad").textContent;
        window.onload = function(){
            if (good == "") {
                good = 0;
                document.getElementById("good").innerText = 0;
            }
            if (bad == "") {
                bad = 0;
                document.getElementById("bad").innerText = 0;
            }              
        }
         
        /*点赞的数量：*/
        function sendGood(){
            good = parseInt(good) + 1;
            document.getElementById("good").innerText = good;
             
            document.getElementById("goodSpan").onclick = function(e){
                e.preventDefault();
                e.stopImmediatePropagation();
            }
        }
         
         
        /*踩的数量：*/
        function sendBad(){
            bad = parseInt(bad) + 1;
            document.getElementById("bad").innerText = bad;
            document.getElementById("badSpan").onclick = function(e){
                e.preventDefault();
                e.stopImmediatePropagation();
            }
        }
    </script>
</body>
</html>